package academic.ui.client.view;



import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

import ui.client.GenericContainerTag;

import academic.ui.client.config.CSSConstants;
import academic.ui.client.presenter.ReceiptPresenter;
import academic.ui.client.widgets.ModalBox;
import academic.ui.client.widgets.YourPurchase;
import ecommerce.soco.shared.GWT_Product;

public class ReceiptView extends ModalView implements ReceiptPresenter.MyView {

	@Inject
	protected ReceiptView(CSSConstants cssConstants) {
		super();
		div.add(modalBox);
		div.setStyleName("modal");
		modalBox.modalContent.add(close);
		hide();
	}

	public ModalBox modalBox = new ModalBox();
	
	public GenericContainerTag div = new GenericContainerTag("div");
	
	public Button close = new Button("close");

	@Override
	public Widget asWidget() {
		return div;
	}

	@Override
	public void setup(GWT_Product product, String quantity) {
		positionDialog(modalBox,420,50);
		positionBackground();
		YourPurchase yp = new YourPurchase();
		yp.setup(product,quantity);
		modalBox.setContent(yp);
	}
	
	@Override
	public HasClickHandlers getCloseButton() {
		return close;
	}

	@Override
	public void hide() {
		super.hide();
	}
	
	
	

	
	

}
